package com.xingkeduo.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author chi  2019-05-05 10:10
 **/
@NoArgsConstructor
@Data
public class PayResult {
    /**
     * error : 0
     * reason : 0
     * content : {"order_no":"2019050300004058","out_order_no":"123633710220190503171802876083","store_id":"7","jsApiParameters":{"appId":"wx9b65e35c7d64de0c","nonceStr":"133rmmbfoxfvk1i1ft121i2x160mhij5","package":"prepay_id=wx03171827332554f1f2ccf4220421359023","signType":"MD5","timeStamp":"1556875107","paySign":"98C85588F039CF4A9D8B9BF6DE56244E"}}
     */

    private int error;
    private Object reason;
    private Object content;


    public PayResult returnSuccess(Object content){
        this.error = 0;
        this.content = content;
        return this;
    }

    public PayResult returnError(Object reason){
        this.error = 1;
        this.reason = reason;
        return this;
    }

    public PayResult returnErrorUserAuth(Object reason){
        this.error = 9004;
        this.reason = reason;
        return this;
    }
}
